Passing Visitor Variables to an External Website

There may be times when you want to redirect the landing page visitor to an external website, while still preserving their personalized data.

One way to do this is by passing these variables is through the URL. 
For example: domain.com?firstName=Joe&lastName=Smith

You can then use these URL variables to dynamically display them on your external website. 

You can display the the URL variables using PHP:

Welcome to our website <?php echo $_GET['firstName']; ?>!<br>
	

Or, if your using our javascipt snippet (such as with our  Hubspot or Unbounce integrations), you can use the hashtag variables. 

Welcome to our website #firstName!
	

Setting up the Redirect

In your Landing Page's index.php file, place the code below just under the "PURL CODE" located at the top of the file. 

<?php header('Location: http://domain.com?firstName='.$visitor->firstName.'&lastName='.$visitor->lastName); ?>
	

And if you wanted to redirect, only when a specific page is visited, you could use...

<?php <br>if($_GET['page'] == 100) {       
    header('Location: http://domain.com?firstName='.$visitor->firstName.'&lastName='.$visitor->lastName); <br>}<br>?>
	

...which is telling the website to redirect the visitor when they reach the "Thank You" page (100).

Any of the visitor variables can be passed through the URL.